package xuesheng

import (
	"fmt"
	"time"
)

func Login() (bool, time.Time, string, int) {
	fmt.Println("请输入用户名")
	var name string
	fmt.Scanln(&name)
	fmt.Println("请输入密码")
	var pswd string
	fmt.Scanln(&pswd)
	fmt.Println("请输入年龄")
	var age int
	fmt.Scanln(&age)
	if name == "libin" && pswd == "123456" {
		return true, time.Now(), name, age
	}
	return false, time.Now(), "", 0
}

var Account float32

func Chongzhi(moneyKind string, edu float32) bool {
	switch moneyKind {
	case "usd":
		Account = Account + edu*7.11
	case "rmb":
		Account = Account + edu
	case "jp":
		Account = Account + edu*0.01
	default:
		fmt.Println("只接受美元，人民币和日元充值")
		return false
	}

	fmt.Println("现在的额度是", Account)
	return true

}
func Chifan() {
	fmt.Println("请选择菜单，1，蛋炒饭，2.炸酱面，3.回锅肉")
	if Account <= 0 {
		fmt.Println("我们这里不赊账,请先充值")
		return
	}
	var caidan int
	fmt.Scanln(&caidan)
	switch caidan {
	case 1:
		if Account < 5 {
			fmt.Println("你的钱不够吃 蛋炒饭")
			return
		}
		Account = Account - 5
	case 2:
		if Account < 7 {
			fmt.Println("你的钱不够吃 炸酱面")
			return
		}
		Account = Account - 7
	case 3:
		if Account < 10 {
			fmt.Println("你的钱不够吃 回锅肉")
			return
		}
		Account = Account - 10

	}
	fmt.Println("用餐完毕，现在钱包还剩:", Account)

}
func BMI() {

}
